package cn.kgc.redis.controller;

import cn.kgc.redis.entity.Dept;
import cn.kgc.redis.service.DeptService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 课工场
 * @date 2024/8/20
 * @description
 */
@RestController
@RequestMapping("dept")
public class DeptController {

    @Resource
    private DeptService deptService;

    @GetMapping("list")
    public List<Dept> deptList() {
        return deptService.list();
    }

    @GetMapping("delete")
    public Boolean removeDept(Integer id) {
        return deptService.removeById(id);
    }
}
